package controller;

public class FileDataPackage {
	 
	private int dataLength;
	private byte[] databuff;
	
	public final static byte[] EOF = new byte[]{'E', 'O','F'};
	
	public FileDataPackage() {
		dataLength = 0;
		databuff = new byte[2048];
	}
	
	public byte[] getPackageData() {
		byte[] pData = new byte[dataLength];
		// end comment
		System.arraycopy(databuff, 0, pData, 0, dataLength);
		return pData;
	}
	
	public void setData(byte[] data, int bsize) {
		dataLength = bsize;
		for(int i=0; i<databuff.length; i++) {
			if(i<bsize) {
				databuff[i] = data[i];
			} else {
				databuff[i] = ' ';
			}
		}
	}
}
